Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 5 - Sequence Grabber Components


Summary of Sequence Grabber Components

C Summary

Constants

/* sequence grabber component type */
#define SeqGrabComponentType 'barg'

/* sequence grabber channel type */
#define SeqGrabChannelType 'sgch'
/* SGGrabPict function grabPictFlags parameter flags */
enum {
      grabPictOffScreen = 1,     /* place in offscreen graphics world */
      grabPictIgnoreClip = 2     /* ignore channel clipping regions */
   };
/* flag for SGSetFlags and SGGetFlags functions */
#define sgFlagControlledGrab (1)/* controlled grab */
/* flags for SGSetChannelPlayFlags and SGGetChannelPlayFlags functions */
#define channelPlayNormal 0      /* use default playback methodology */
#define channelPlayFast 1        /* achieve fast playback rate */
#define channelPlayHighQuality 2 /* achieve high quality image */
#define channelPlayAllData 4     /* play all captured data */
/* flags for SGSetDataOutput and SGGetDataOutput functions */
enum {
   seqGrabToDisk              = 1,  /* write recorded data to movie */
   seqGrabToMemory            = 2,  /* store recorded data in memory */
   seqGrabDontUseTempMemory   = 4,  /* no temporary memory for recorded 
                                       data */
   seqGrabAppendToFile        = 8,  /* add recorded data to file's data 
                                       fork */
   seqGrabDontAddMovieResource = 16, /* don't add movie resource to file */
   seqGrabDontMakeMovie       = 32  /* don't put data into movie */
};
typedef unsigned char SeqGrabDataOutputEnum;
/* usage flags for SGSetChannelUsage and SGGetChannelUsage functions */
enum {
   seqGrabRecord           = 1,  /* used during record operations */
   seqGrabPreview          = 2,  /* used during preview operations */
   seqGrabPlayDuringRecord = 4   /* plays data during record operation */
};
typedef unsigned char SeqGrabUsageEnum;
/* SGGetChannelInfo function flags */
enum {
   seqGrabHasBounds           = 1,  /* visual representation of data */
   seqGrabHasVolume           = 2,  /* audio representation of data */ 
   seqGrabHasDiscreteSamples  = 4   /* data organized in discrete frames */
};typedef unsigned char SeqGrabChannelInfoEnum;

/* device list structure flags */

#define sgDeviceListWithIcons (1)               /* include icons */
#define sgDeviceListDontCheckAvailability (2)   /* don't check available */

/* data function write operation types */

enum {
   seqGrabWriteAppend,              /* append to file */
   seqGrabWriteReserve,             /* reserve space in file */
   seqGrabWriteFill                 /* fill reserved space */
};

/* SGPause and SGGetPause options */

enum {
   seqGrabUnpause = 0,                       /* release grabber */
   seqGrabPause = 1,                         /* pause all playback */
   seqGrabPauseForMenu = 3                   /* pause for menu display */
};
/* selectors for basic sequence grabber component functions */
   kSGInitializeSelect              = 0x1;   /* SGInitialize */
   kSGSetDataOutputSelect           = 0x2;   /* SGSetDataOutput */
   kSGGetDataOutputSelect           = 0x3;   /* SGGetDataOutput */
   kSGSetGWorldSelect               = 0x4;   /* SGSetGWorld */
   kSGGetGWorldSelect               = 0x5;   /* SGGetGWorld */ 
   kSGNewChannelSelect              = 0x6;   /* SGNewChannel */
   kSGDisposeChannelSelect          = 0x7;   /* SGDisposeChannel */
   kSGStartPreviewSelect            = 0x10;  /* SGStartPreview */
   kSGStartRecordSelect             = 0x11;  /* SGStartRecord */
   kSGIdleSelect                    = 0x12;  /* SGIdle */
   kSGStopSelect                    = 0x13;  /* SGStop */
   kSGPauseSelect                   = 0x14;  /* SGPause */
   kSGPrepareSelect                 = 0x15;  /* SGPrepare */
   kSGReleaseSelect                 = 0x16;  /* SGRelease */
   kSGGetMovieSelect                = 0x17;  /* SGGetMovie */
   kSGSetMaximumRecordTimeSelect    = 0x18;  /* SGSetMaximumRecordTime */
   kSGGetMaximumRecordTimeSelect    = 0x19;  /* SGGetMaximumRecordTime */
   kSGGetStorageSpaceRemainingSelect= 0x1a;  /* SGGetStorageSpaceRemaining */
                              
   kSGGetTimeRemainingSelect        = 0x1b;  /* SGGetTimeRemaining */   
   kSGGrabPictSelect                = 0x1c;  /* SGGrabPict */
   kSGGetLastMovieResIDSelect       = 0x1d;  /* SGGetLastMovieResID */
   kSGSetFlagsSelect                = 0x1e;  /* SGSetFlags */
   kSGGetFlagsSelect                = 0x1f;  /* SGGetFlags */
   kSGSetDataProcSelect             = 0x20;  /* SGSetDataProc */
   kSGNewChannelFromComponentSelect = 0x21;  /* SGNewChannelFromComponent */
   kSGDisposeDeviceListSelect       = 0x22;  /* SGDisposeDeviceList */
   kSGAppendDeviceListToMenuSelect  = 0x23;  /* SGAppendDeviceListToMenu */
   kSGSetSettingsSelect             = 0x24;  /* SGSetSettings */
   kSGGetSettingsSelect             = 0x25;  /* SGGetSettings */
   kSGGetIndChannelSelect           = 0x26;  /* SGGetIndChannel */
   kSGUpdateSelect                  = 0x27;  /* SGUpdate */
   kSGGetPauseSelect                = 0x28;  /* SGGetPause */
   kSGSettingsDialogSelect          = 0x29;  /* SGSettingsDialog */
   kSGGetAlignmentProcSelect        = 0x2A;  /* SGGetAlignmentProc */
   kSGSetChannelSettingsSelect      = 0x2B;  /* SGSetChannelSettings */
   kSGGetChannelSettingsSelect      = 0x2C;  /* SGGetChannelSettings */

/* selectors for common channel configuration functions */
   kSGCSetChannelUsageSelect     = 0x80;     /* SGCSetChannelUsage */
   kSGCGetChannelUsageSelect     = 0x81;     /* SGCGetChannelUsage */
   kSGCSetChannelBoundsSelect    = 0x82;     /* SGCSetChannelBounds */
   kSGCGetChannelBoundsSelect    = 0x83;     /* SGCGetChannelBounds */
   kSGCSetChannelVolumeSelect    = 0x84;     /* SGCSetChannelVolume */
   kSGCGetChannelVolumeSelect    = 0x85;     /* SGCGetChannelVolume */
   kSGCGetChannelInfoSelect      = 0x86;     /* SGCGetChannelInfo */
   kSGCSetChannelPlayFlagsSelect = 0x87;     /* SGCSetChannelPlayFlags */  
   kSGCGetChannelPlayFlagsSelect = 0x88;     /* SGCGetChannelPlayFlags */
   kSGCSetChannelMaxFramesSelect = 0x89;     /* SGCSetChannelMaxFrames */
   kSGCGetChannelMaxFramesSelect = 0x8a;     /* SGCGetChannelMaxFrames */
   kSGCSetChannelRefConSelect    = 0x8b;     /* SGCSetChannelRefCon */
   kSGCSetChannelClipSelect      = 0x8C;     /* SGCSetChannelClip */
   kSGCGetChannelClipSelect      = 0x8D;     /* SGCGetChannelClip */
   kSGCGetChannelSampleDescriptionSelect = 0x8E;
                                       /* SGCGetChannelSampleDescription */
   kSGCGetChannelDeviceListSelect   = 0x8F;  /* SGCGetChannelDeviceList */
   kSGCSetChannelDeviceSelect       = 0x90;  /* SGCSetChannelDevice */
   kSGCSetChannelMatrixSelect       = 0x91;  /* SGCSetChannelMatrix */
   kSGCGetChannelMatrixSelect       = 0x92;  /* SGCGetChannelMatrix */
   kSGCGetChannelTimeScaleSelect    = 0x93;  /* SGCGetChannelTimeScale */
   
   /* selectors for video channel configuration functions */
   kSGCGetSrcVideoBoundsSelect      = 0x100; /* SGCGetSrcVideoBounds */
   kSGCSetVideoRectSelect           = 0x101; /* SGCSetVideoRect */
   kSGCGetVideoRectSelect           = 0x102; /* SGCGetVideoRect */
   kSGCGetVideoCompressorTypeSelect = 0x103; /* SGCGetVideoCompressorType */
   kSGCSetVideoCompressorTypeSelect = 0x104; /* SGCSetVideoCompressorType */
   kSGCSetVideoCompressorSelect     = 0x105; /* SGCSetVideoCompressor */
   kSGCGetVideoCompressorSelect     = 0x106; /* SGCGetVideoCompressor */
   kSGCGetVideoDigitizerComponentSelect 
                                    = 0x107;
                                          /* SGCGetVideoDigitizerComponent */
   kSGCSetVideoDigitizerComponentSelect 
                                    = 0x108; 
                                          /* SGCSetVideoDigitizerComponent */
   kSGCVideoDigitizerChangedSelect  = 0x109; /* SGCVideoDigitizerChanged */
   kSGCSetVideoBottlenecksSelect    = 0x10a; /* SGCSetVideoBottlenecks */
   kSGCGetVideoBottlenecksSelect    = 0x10b; /* SGCGetVideoBottlenecks */
   kSGCGrabFrameSelect              = 0x10c; /* SGCGrabFrame */
   kSGCGrabFrameCompleteSelect      = 0x10d; /* SGCGrabFrameComplete */
   kSGCDisplayFrameSelect           = 0x10e; /* SGCDisplayFrame */
   kSGCCompressFrameSelect          = 0x10f; /* SGCCompressFrame */
   kSGCCompressFrameCompleteSelect  = 0x110; /* SGCCompressFrameComplete */
   kSGCAddFrameSelect               = 0x111; /* SGCAddFrame */
   kSGCTransferFrameForCompressSelect = 0x112;
                                          /* SGCTransferFrameForCompress */
   kSGCSetCompressBufferSelect      = 0x113; 
                                             /* SGCSetCompressBuffer */
   kSGCGetCompressBufferSelect      = 0x114; 
                                             /* SGCGetCompressBuffer */
   kSGCGetBufferInfoSelect          = 0x115; /* SGCGetBufferInfo */
   kSGCSetUseScreenBufferSelect     = 0x116; /* SGCSetUseScreenBuffer */
   kSGCGetUseScreenBufferSelect     = 0x117; /* SGCGetUseScreenBuffer */
   kSGCGrabCompressCompleteSelect   = 0x118; /* SGCGrabCompressComplete */
   kSGCDisplayCompressSelect        = 0x119; /* SGCDisplayCompress */
   kSGCSetFrameRateSelect           = 0x11A; /* SGCSetFrameRate */
   kSGCGetFrameRateSelect           = 0x11B; /* SGCGetFrameRate */
    
   /* selectors for sound channel configuration functions */
   kSGCSetSoundInputDriverSelect       = 0x100; /* SGCSetSoundInputDriver */
   kSGCGetSoundInputDriverSelect       = 0x101; /* SGCGetSoundInputDriver */
   kSGCSoundInputDriverChangedSelect   = 0x102; 
                                       /* SGCSoundInputDriverChanged */
   kSGCSetSoundRecordChunkSizeSelect   = 0x103; 
                                       /* SGCSetSoundRecordChunkSize */
   kSGCGetSoundRecordChunkSizeSelect   = 0x104;
                                       /* SGCGetSoundRecordChunkSize */
   kSGCSetSoundInputRateSelect         = 0x105; /* SGCSetSoundInputRate */
   kSGCGetSoundInputRateSelect         = 0x106; /* SGCGetSoundInputRate */
   kSGCSetSoundInputParametersSelect   = 0x107; 
                                             /* SGCSetSoundInputParameters */
   kSGCGetSoundInputParametersSelect   = 0x108;
                                             /* SGCGetSoundInputParameters */
   
   /* selectors for utility functions provided to channel components */
   kSGWriteMovieDataSelect          = 0x100; /* SGWriteMovieData */
   kSGAddFrameReferenceSelect       = 0x101; / *SGAddFrameReference */
   kSGGetNextFrameReferenceSelect   = 0x102; /* SGGetNextFrameReference */
   kSGGetTimeBaseSelect             = 0x103; /* SGGetTimeBase */
   kSGSortDeviceListSelect          = 0x104; /* SGSortDeviceList */
   kSGAddMovieDataSelect            = 0x105; /* SGAddMovieData */
   kSGChangedSourceSelect           = 0x106; /* SGChangedSource */

Data Types

struct SGCompressInfo {
   Ptr            buffer;     /* buffer for compressed image */
   unsigned long  bufferSize; /* bytes of image data in buffer */
   unsigned char  similarity; /* relative similarity */
   unsigned char  reserved;   /* reserved--set to 0 */
};
typedef struct SGCompressInfo SGCompressInfo;
struct SeqGrabFrameInfo {
   long        frameOffset;   /* offset to the sample */
   long        frameTime;     /* time that frame was captured */
   long        frameSize;     /* number of bytes in sample */
   SGChannel   frameChannel;  /* current connection to channel */
   long        frameRefCon;   /* reference constant for channel */
};
struct VideoBottles {
   short                      procCount;           /* count of callbacks */
   GrabProc                   grabProc;            /* grab function */
   GrabCompleteProc           grabCompleteProc;    /* grab-complete 
                                                      function */
   DisplayProc                displayProc;         /* display function */
   CompressProc               compressProc;        /* compress function */
   CompressCompleteProc       compressCompleteProc;
                                                   /* compress-complete
                                                      function */
   AddFrameProc               addFrameProc;        /* add-frame function */
   TransferFrameProc          transferFrameProc;   /* transfer-frame 
                                                      function */
   GrabCompressCompleteProc   grabCompressCompleteProc;
                                                   /* grab-compress-complete
                                                      function */
   DisplayCompressProc        displayCompressProc; /* display-compress
                                                      function */
};
typedef struct VideoBottles VideoBottles;
typedef struct SGDeviceListRecord {
   short          count;            /* count of devices */
   short          selectedIndex;    /* current device */
   long           reserved;         /* set to 0 */
   SGDeviceName   entry[1];         /* device names */
} SGDeviceListRecord, *SGDeviceListPtr, **SGDeviceList;
typedef struct SGDeviceName {
   Str63       name;             /* device name */
   Handle      icon;             /* device icon */
   long        flags;            /* flags */
   long        refCon;           /* set to 0 */
   long        reserved;         /* set to 0 */
} SGDeviceName;

Sequence Grabber Component Functions

Configuring Sequence Grabber Components

pascal ComponentResult SGInitialize
(SeqGrabComponent s);
pascal ComponentResult SGSetDataOutput 
(SeqGrabComponent s, FSSpec *movieFile,
long whereFlags);
pascal ComponentResult SGGetDataOutput 
(SeqGrabComponent s,
FSSpec *movieFile, long *whereFlags);
pascal ComponentResult SGSetGWorld
(SeqGrabComponent s, CGrafPtr gp, GDHandle gd);
pascal ComponentResult SGGetGWorld
(SeqGrabComponent s, CGrafPtr *gp, 
GDHandle *gd);
pascal ComponentResult SGNewChannel
(SeqGrabComponent s, OSType channelType, SGChannel *ref);
pascal ComponentResult SGNewChannelFromComponent 
(SeqGrabComponent s, SGChannel *newChannel, 
Component sgChannelComponent);
pascal ComponentResult SGGetIndChannel 
(SeqGrabComponent s, short index, 
SGChannel *ref, OSType *chanType);
pascal ComponentResult SGDisposeChannel
(SeqGrabComponent s, SGChannel c);
pascal ComponentResult SGSetDataProc 
(SeqGrabComponent sg, SGDataProc proc, 
long refCon);
pascal ComponentResult SGGetAlignmentProc 
(SeqGrabComponent s, 
AlignmentProcRecordPtr alignmentProc);

Controlling Sequence Grabber Components

pascal ComponentResult SGStartPreview
(SeqGrabComponent s);
pascal ComponentResult SGStartRecord
(SeqGrabComponent s);
pascal ComponentResult SGIdle
(SeqGrabComponent s);
pascal ComponentResult SGUpdate 
(SeqGrabComponent s, RgnHandle updateRgn);
pascal ComponentResult SGStop
(SeqGrabComponent s);
pascal ComponentResult SGPause
(SeqGrabComponent s, Byte pause);
pascal ComponentResult SGGetPause 
(SeqGrabComponent s, Byte *paused);
pascal ComponentResult SGPrepare
(SeqGrabComponent s, Boolean prepareForPreview, 
Boolean prepareForRecord);
pascal ComponentResult SGRelease
(SeqGrabComponent s);
pascal Movie SGGetMovie(SeqGrabComponent s);
pascal ComponentResult SGGetLastMovieResID 
(SeqGrabComponent s, short *resID);
pascal ComponentResult SGGrabPict 
(SeqGrabComponent s, PicHandle *p, 
const Rect *bounds, short offscreenDepth, 
long grabPictFlags);

Working With Sequence Grabber Settings

pascal ComponentResult SGSettingsDialog 
(SeqGrabComponent s, SGChannel c, 
short numPanels, Component *panelList, 
long flags, SGModalFilterProcPtr proc, 
long procRefNum);
pascal ComponentResult SGGetSettings 
(SeqGrabComponent s, UserData *ud, long flags);
pascal ComponentResult SGSetSettings 
(SeqGrabComponent s, UserData ud, long flags);
pascal ComponentResult SGGetChannelSettings 
(SeqGrabComponent s, SGChannel c, UserData *ud, long flags);
pascal ComponentResult SGSetChannelSettings 
(SeqGrabComponent s, SGChannel c, UserData ud, long flags);

Working With Sequence Grabber Characteristics

pascal ComponentResult SGSetMaximumRecordTime
(SeqGrabComponent s, unsigned long ticks);
pascal ComponentResult SGGetMaximumRecordTime 
(SeqGrabComponent s, unsigned long *ticks);
pascal ComponentResult SGGetStorageSpaceRemaining 
(SeqGrabComponent s, unsigned long *bytes);
pascal ComponentResult SGGetTimeRemaining 
(SeqGrabComponent s, long *ticksLeft);
pascal ComponentResult SGGetTimeBase
(SeqGrabComponent s, TimeBase *tb);
pascal ComponentResult SGSetFlags 
(SeqGrabComponent s, long sgFlags);
pascal ComponentResult SGGetFlags
(SeqGrabComponent s, long *sgFlags);

Working With Channel Characteristics

pascal ComponentResult SGSetChannelUsage
(SGChannel c, long usage);
pascal ComponentResult SGGetChannelUsage
(SGChannel c, long *usage);
pascal ComponentResult SGGetChannelInfo
(SGChannel c, long *channelInfo);
pascal ComponentResult SGSetChannelPlayFlags
(SGChannel c, long playFlags);
pascal ComponentResult SGGetChannelPlayFlags
(SGChannel c, long *playFlags);
pascal ComponentResult SGSetChannelMaxFrames
(SGChannel c, long frameCount);
pascal ComponentResult SGGetChannelMaxFrames
(SGChannel c, long *frameCount);
pascal ComponentResult SGSetChannelBounds
(SGChannel c, const Rect *bounds);
pascal ComponentResult SGGetChannelBounds
(SGChannel c, Rect *bounds);
pascal ComponentResult SGSetChannelVolume
(SGChannel c, short volume);
pascal ComponentResult SGGetChannelVolume
(SGChannel c, short *volume);
pascal ComponentResult SGSetChannelRefCon
(SGChannel c, long refCon);
pascal ComponentResult SGGetChannelSampleDescription 
(SGChannel c, Handle sampleDesc);
pascal ComponentResult SGGetChannelTimeScale 
(SGChannel c, TimeScale *scale);
pascal ComponentResult SGSetChannelClip 
(SGChannel c, RgnHandle theClip);
pascal ComponentResult SGGetChannelClip 
(SGChannel c, RgnHandle *theClip);
pascal ComponentResult SGSetChannelMatrix 
(SGChannel c, const MatrixRecord *m);
pascal ComponentResult SGGetChannelMatrix 
(SGChannel c, MatrixRecord *m);

Working With Channel Devices

pascal ComponentResult SGGetChannelDeviceList 
(SGChannel c, long selectionFlags, 
SGDeviceList *list);
pascal ComponentResult SGDisposeDeviceList 
(SeqGrabComponent s, SGDeviceList list);
pascal ComponentResult SGAppendDeviceListToMenu 
(SeqGrabComponent s, SGDeviceList list, MenuHandle mh);
pascal ComponentResult SGSetChannelDevice 
(SGChannel c, StringPtr name);

Working With Video Channels

pascal ComponentResult SGGetSrcVideoBounds 
(SGChannel c, Rect *r);
pascal ComponentResult SGSetVideoRect
(SGChannel c, Rect *r);
pascal ComponentResult SGGetVideoRect 
(SGChannel c, Rect *r);
pascal ComponentResult SGSetVideoCompressorType
(SGChannel c, OSType compressorType);
pascal ComponentResult SGGetVideoCompressorType
(SGChannel c, OSType *compressorType);
pascal ComponentResult SGSetVideoCompressor
(SGChannel c, short depth, 
CompressorComponent compressor, 
CodecQ spatialQuality, 
CodecQ temporalQuality, long keyFrameRate);
pascal ComponentResult SGGetVideoCompressor
(SGChannel c, short *depth, 
CompressorComponent *compressor, 
CodecQ *spatialQuality, 
CodecQ *temporalQuality, long *keyFrameRate);
pascal ComponentResult SGSetVideoDigitizerComponent
(SGChannel c, ComponentInstance vdig);
pascal ComponentInstance SGGetVideoDigitizerComponent
(SGChannel c);
pascal ComponentResult SGVideoDigitizerChanged
(SGChannel c);
pascal ComponentResult SGSetCompressBuffer
(SGChannel c, short depth, 
const Rect *compressSize);
pascal ComponentResult SGGetCompressBuffer
(SGChannel c, short *depth, Rect *compressSize);
pascal ComponentResult SGSetFrameRate 
(SGChannel c, Fixed frameRate);
pascal ComponentResult SGGetFrameRate 
(SGChannel c, Fixed *frameRate);
pascal ComponentResult SGSetUseScreenBuffer 
(SGChannel c, Boolean useScreenBuffer);
pascal ComponentResult SGGetUseScreenBuffer 
(SGChannel c, Boolean *useScreenBuffer);

Working With Sound Channels

pascal ComponentResult SGSetSoundInputDriver
(SGChannel c, const Str255 driverName);
pascal long SGGetSoundInputDriver
(SGChannel c);
pascal ComponentResult SGSoundInputDriverChanged
(SGChannel c);
pascal ComponentResult SGSetSoundRecordChunkSize
(SGChannel c, long seconds);
pascal long SGGetSoundRecordChunkSize
(SGChannel c);
pascal ComponentResult SGSetSoundInputRate
(SGChannel c, Fixed rate);
pascal Fixed SGGetSoundInputRate
(SGChannel c); 
pascal ComponentResult SGSetSoundInputParameters 
(SGChannel c, short sampleSize, 
short numChannels, OSType compressionType);
pascal ComponentResult SGGetSoundInputParameters 
(SGChannel c, short *sampleSize, 
short *numChannels, OSType *compressionType);

Video Channel Callback Functions

pascal ComponentResult SGSetVideoBottlenecks
(SGChannel c, VideoBottles *vb);
pascal ComponentResult SGGetVideoBottlenecks
(SGChannel c, VideoBottles *vb);

Utility Functions for Video Channel Callback Functions

pascal ComponentResult SGGetBufferInfo
(SGChannel c, short bufferNum, 
PixMapHandle *bufferPM, Rect *bufferRect, 
GWorldPtr *compressBuffer, 
Rect *compressBufferRect);
pascal ComponentResult SGGrabFrame
(SGChannel c, short bufferNum);
pascal ComponentResult SGGrabFrameComplete
(SGChannel c, short bufferNum, Boolean *done);
pascal ComponentResult SGDisplayFrame
(SGChannel c, short bufferNum, 
MatrixRecord *mp, RgnHandle clipRgn);
pascal ComponentResult SGCompressFrame
(SGChannel c, short bufferNum);
pascal ComponentResult SGCompressFrameComplete
(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci);
pascal ComponentResult SGAddFrame
(SGChannel c, short bufferNum, 
TimeValue atTime, TimeScale scale, 
const SGCompressInfo *ci);
pascal ComponentResult SGTransferFrameForCompress
(SGChannel c, short bufferNum, MatrixRecord *mp, 
RgnHandle clipRgn);
pascal ComponentResult SGGrabCompressComplete 
(SGChannel c, Boolean *done, 
SGCompressInfo *ci, TimeRecord *tr);
pascal ComponentResult SGDisplayCompress 
(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn);

Application-Defined Functions

pascal ComponentResult MyGrabFunction 
(SGChannel c, short bufferNum, long refCon);
pascal ComponentResult MyGrabCompleteFunction 
(SGChannel c, short bufferNum, Boolean *done, long refCon);
pascal ComponentResult MyDisplayFunction 
(SGChannel c, short bufferNum, 
MatrixRecord *mp, RgnHandle clipRgn, 
long refCon);
pascal ComponentResult MyCompressFunction 
(SGChannel c, short bufferNum, long refCon);
pascal ComponentResult MyCompressCompleteFunction 
(SGChannel c, short bufferNum, Boolean *done,
SGCompressInfo *ci, long refCon);
pascal ComponentResult MyAddFrameFunction 
(SGChannel c, short bufferNum,
TimeValue atTime, TimeScale scale,
SGCompressInfo ci, long refCon);
pascal ComponentResult MyTransferFrameFunction 
(SGChannel c, 															short bufferNum, 															MatrixRecord *mp,
RgnHandle clipRgn, 															long refCon);
pascal ComponentResult MyGrabCompressCompleteFunction 
(SGChannel c, Boolean *done, 
SGCompressInfo *ci, TimeRecord *tr, 
long refCon);
pascal ComponentResult MyDisplayCompressFunction 
(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
pascal OSErr MyDataFunction(SGChannel c, Ptr p, long len, long *offset, 
long chRefCon, TimeValue time, 
short writeType, long refCon);
pascal Boolean MyModalFilter
(DialogPtr theDialog, EventRecord *theEvent, short *itemHit, long refCon);

Pascal Summary

Constants

CONST
   {sequence grabber component type}
   SeqGrabComponentType          = 'barg';

   {sequence grabber channel type}
   SeqGrabChannelType            = 'sgch'

   {SGGrabPict function grabPictFlags parameter flags}
   grabPictOffScreen             = 1;  {place in offscreen graphics world}
   grabPictIgnoreClip            = 2;  {ignore channel clipping regions}
   
   {flag for SGSetFlags and SGGetFlags functions}
   sgFlagControlledGrab          = 1;  {controlled grab}

   {flags for SGSetChannelPlayFlags and SGGetChannelPlayFlags functions}
   channelPlayNormal             = 0;  {use default playback methodology}
   channelPlayFast               = 1;  {achieve fast playback rate}
   channelPlayHighQuality        = 2;  {achieve high quality image}
   channelPlayAllData            = 4;  {play all captured data}
   
   {flags for SGSetDataOutput and SGGetDataOutput functions}
   seqGrabToDisk                 = 1;  {write recorded data to specified }
                                       { QuickTime movie}
   seqGrabToMemory               = 2;  {store recorded data in memory until }
                                       { completion of recording process}
   seqGrabDontUseTempMemory      = 4;  {don't use temporary memory to store }
                                       { recorded data}
   seqGrabAppendToFile           = 8;  {add recorded data to data fork of }
                                       { specified movie file}
   seqGrabDontAddMovieResource   = 16; {don't add movie resource to }
                                       { specified movie file}

   {usage flags for SGSetChannelUsage and SGGetChannelUsage functions}
   seqGrabRecord                    = 1;  {used during record operations}
   seqGrabPreview                   = 2;  {used during preview operations}
   seqGrabPlayDuringRecord          = 4;  {used during record operations}
   
   {SGGetChannelInfo function flags}
   seqGrabHasBounds                 = 1;  {visual representation of data}
   seqGrabHasVolume                 = 2;  {audio representation of data}
   seqGrabHasDiscreteSamples        = 4;  {data organized in discrete frames}

   {device list structure flags}
   sgDeviceListWithIcons               = 1;  {include icons}
   sgDeviceListDontCheckAvailability   = 2;  {do not check availability }
                                             { of device}
   {data function write operation types}
   seqGrabWriteAppend      = 0;  {append to file}
   seqGrabWriteReserve     = 1;  {reserve space in file}
   seqGrabWrite            = 2;  {fill reserved space}
   {SGPause and SGGetPause options}
   seqGrabUnpause       = 0;     {release grabber}
   seqGrabPause         = 1;     {pause all playback}
   seqGrabPauseForMenu  = 3;     {pause for menu display}
   
   {selectors for basic sequence grabber component functions}
   kSGInitializeSelect              = $1;    {SGInitialize}
   kSGSetDataOutputSelect           = $2;    {SGSetDataOutput}
   kSGGetDataOutputSelect           = $3;    {SGGetDataOutput}
   kSGSetGWorldSelect               = $4;    {SGSetGWorld}
   kSGGetGWorldSelect               = $5;    {SGGetGWorld}     
   kSGNewChannelSelect              = $6;    {SGNewChannel}
   kSGDisposeChannelSelect          = $7;    {SGDisposeChannel}
   kSGStartPreviewSelect            = $10;   {SGStartPreview}
   kSGStartRecordSelect             = $11;   {SGStartRecord}
   kSGIdleSelect                    = $12;   {SGIdle}
   kSGStopSelect                    = $13;   {SGStop}
   kSGPauseSelect                   = $14;   {SGPause}
   kSGPrepareSelect                 = $15;   {SGPrepare}
   kSGReleaseSelect                 = $16;   {SGRelease}
   kSGGetMovieSelect                = $17;   {SGGetMovie}
   kSGSetMaximumRecordTimeSelect    = $18;   {SGSetMaximumRecordTime}
   kSGGetMaximumRecordTimeSelect    = $19;   {SGGetMaximumRecordTime}
   kSGGetStorageSpaceRemainingSelect= $1A;   {SGGetStorageSpaceRemaining}     
   kSGGetTimeRemainingSelect        = $1B;   {SGGetTimeRemaining}       
   kSGGrabPictSelect                = $1C;   {SGGrabPict}
   kSGGetLastMovieResIDSelect       = $1D;   {SGGetLastMovieResID}
   kSGSetFlagsSelect                = $1E;   {SGSetFlags}
   kSGGetFlagsSelect                = $1F;   {SGGetFlags}
   kSGSetDataProcSelect             = $20;   {SGSetDataProc}
   kSGNewChannelFromComponentSelect = $21;   {SGNewChannelFromComponent}
   kSGDisposeDeviceListSelect       = $22;   {SGDisposeDeviceList}
   kSGAppendDeviceListToMenuSelect  = $23;   {SGAppendDeviceListToMenu}
   kSGSetSettingsSelect             = $24;   {SGSetSettings}
   kSGGetSettingsSelect             = $25;   {SGGetSettings}
   kSGGetIndChannelSelect           = $26;   {SGGetIndChannel}
   kSGUpdateSelect                  = $27;   {SGUpdate}
   kSGGetPauseSelect                = $28;   {SGGetPause}
   kSGSettingsDialogSelect          = $29;   {SGSettingsDialog}
   kSGGetAlignmentProcSelect        = $2A;   {SGGetAlignmentProc}
   kSGSetChannelSettingsSelect      = $2B;   {SGSetChannelSettings}
   kSGGetChannelSettingsSelect      = $2C;   {SGGetChannelSettings}

   {selectors for common channel configuration functions}
   kSGCSetChannelUsageSelect              = $80;   {SGCSetChannelUsage}
   kSGCGetChannelUsageSelect              = $81;   {SGCGetChannelUsage}
   kSGCSetChannelBoundsSelect             = $82;   {SGCSetChannelBounds}
   kSGCGetChannelBoundsSelect             = $83;   {SGCGetChannelBounds}
   kSGCSetChannelVolumeSelect             = $84;   {SGCSetChannelVolume}
   kSGCGetChannelVolumeSelect             = $85;   {SGCGetChannelVolume}
   kSGCGetChannelInfoSelect               = $86;   {SGCGetChannelInfo}
   kSGCSetChannelPlayFlagsSelect          = $87;   {SGCSetChannelPlayFlags}
   kSGCGetChannelPlayFlagsSelect          = $88;   {SGCGetChannelPlayFlags}
   kSGCSetChannelMaxFramesSelect          = $89;   {SGCSetChannelMaxFrames}
   kSGCGetChannelMaxFramesSelect          = $8A;   {SGCGetChannelMaxFrames}
   kSGCSetChannelRefConSelect             = $8B;   {SGCSetChannelRefCon}
   kSGCSetChannelClipSelect               = $8C;   {SGCSetChannelClip}
   kSGCGetChannelClipSelect               = $8D;   {SGCGetChannelClip}
   kSGCGetChannelSampleDescriptionSelect  = $8E; 
                                             {SGCGetChannelSampleDescription}
   kSGCGetChannelDeviceListSelect         = $8F;   {SGCGetChannelDeviceList}
   kSGCSetChannelDeviceSelect             = $90;   {SGCSetChannelDevice}
   kSGCSetChannelMatrixSelect             = $91;   {SGCSetChannelMatrix}
   kSGCGetChannelMatrixSelect             = $92;   {SGCGetChannelMatrix}
   kSGCGetChannelTimeScaleSelect          = $93;   {SGCGetChannelTimeScale}
   
   {selectors for video channel configuration functions}
   kSGCGetSrcVideoBoundsSelect            = $100;  {SGCGetSrcVideoBounds}
   kSGCSetVideoRectSelect                 = $101;  {SGCSetVideoRect}
   kSGCGetVideoRectSelect                 = $102;  {SGCGetVideoRect}
   kSGCGetVideoCompressorTypeSelect       = $103;
                                          {SGCGetVideoCompressorType}
   kSGCSetVideoCompressorTypeSelect       = $104;  
                                          {SGCSetVideoCompressorType}
   kSGCSetVideoCompressorSelect           = $105;  {SGCSetVideoCompressor}
   kSGCGetVideoCompressorSelect           = $106;  {SGCGetVideoCompressor}
   kSGCGetVideoDigitizerComponentSelect   = $107;
                                          {SGCGetVideoDigitizerComponent}
   kSGCSetVideoDigitizerComponentSelect   = $108; 
                                          {SGCSetVideoDigitizerComponent}
   kSGCVideoDigitizerChangedSelect        = $109;  {SGCVideoDigitizerChanged}
   kSGCSetVideoBottlenecksSelect          = $10A;  {SGCSetVideoBottlenecks}
   kSGCGetVideoBottlenecksSelect          = $10B;  {SGCGetVideoBottlenecks}
   kSGCGrabFrameSelect                    = $10C;  {SGCGrabFrame}
   kSGCGrabFrameCompleteSelect            = $10D;  {SGCGrabFrameComplete}
   kSGCDisplayFrameSelect                 = $10E;  {SGCDisplayFrame}
   kSGCCompressFrameSelect                = $10F;  {SGCCompressFrame}
   kSGCCompressFrameCompleteSelect        = $110;  {SGCCompressFrameComplete}
   kSGCAddFrameSelect                     = $111;  {SGCAddFrame}
   kSGCTransferFrameForCompressSelect     = $112;
                                          {SGCTransferFrameForCompress}
   kSGCSetCompressBufferSelect            = $113;  {SGCSetCompressBuffer}
   kSGCGetCompressBufferSelect            = $114;  {SGCGetCompressBuffer}
   kSGCGetBufferInfoSelect                = $115;  {SGCGetBufferInfo}
   kSGCSetUseScreenBufferSelect           = $116;  {SGCSetUseScreenBuffer}
   kSGCGetUseScreenBufferSelect           = $117;  {SGCGetUseScreenBuffer}
   kSGCGrabCompressCompleteSelect         = $118;  {SGCGrabCompressComplete}
   kSGCDisplayCompressSelect              = $119;  {SGCDisplayCompress}
   kSGCSetFrameRateSelect                 = $11A;  {SGCSetFrameRate}
   kSGCGetFrameRateSelect                 = $11B;  {SGCGetFrameRate}
   {selectors for sound channel configuration functions}
   kSGCSetSoundInputDriverSelect       = $100;  {SGCSetSoundInputDriver}
   kSGCGetSoundInputDriverSelect       = $101;  {SGCGetSoundInputDriver}
   kSGCSoundInputDriverChangedSelect   = $102;  {SGCSoundInputDriverChanged}
   kSGCSetSoundRecordChunkSizeSelect   = $103;  {SGCSetSoundRecordChunkSize}
   kSGCGetSoundRecordChunkSizeSelect   = $104;  {SGCGetSoundRecordChunkSize}
   kSGCSetSoundInputRateSelect         = $105;  {SGCSetSoundInputRate}
   kSGCGetSoundInputRateSelect         = $106;  {SGCGetSoundInputRate}
   kSGCSetSoundInputParametersSelect   = $107;  {SGCSetSoundInputParameters}
   kSGCGetSoundInputParametersSelect   = $108;  {SGCGetSoundInputParameters}
   
   {selectors for utility functions provided to channel components}
   kSGWriteMovieDataSelect             = $100;  {SGWriteMovieData}
   kSGAddFrameReferenceSelect          = $101;  {SGAddFrameReference}
   kSGGetNextFrameReferenceSelect      = $102;  {SGGetNextFrameReference}
   kSGGetTimeBaseSelect                = $103;  {SGGetTimeBase}
   kSGSortDeviceListSelect             = $104;  {SGSortDeviceList}
   kSGAddMovieDataSelect               = $105;  {SGAddMovieData}
   kSGChangedSourceSelect              = $106;  {SGChangedSource}

Data Types

TYPE SGCompressInfo = 
   PACKED RECORD
      buffer:        Ptr;     {buffer containing compressed image}
      bufferSize:    LongInt; {bytes of image data in buffer}
      similarity:    Char;    {relative similarity of image }
                              { to previous image in sequence}
      reserved:      Char;    {reserved}
END;
   VideoBottles = 
   RECORD
      procCount:              Integer;             {number of callback }
                                                   { routines in record}
      grabProc:               GrabProc;            {grab function}
      grabCompleteProc:       GrabCompleteProc;    {grab-complete function}
      displayProc:            DisplayProc;         {display function}
      compressProc:           CompressProc;        {compress function}
      compressCompleteProc:   CompressCompleteProc;
                                                   {compress-complete }
                                                   { function}
      addFrameProc:           AddFrameProc;        {add-frame function}
      transferFrameProc:      TransferFrameProc;   {transfer-frame }
                                                   { function}
   END;
   SeqGrabFrameInfo = 
   RECORD
      frameOffset:   LongInt;       {offset to the sample}
      frameTime:     LongInt;       {time that frame was captured}
      frameSize:     LongInt;       {number of bytes in sample}
      frameChannel:  SGChannel;     {current connection to channel}
      frameRefCon:   LongInt;       {reference constant for channel}
   END;
   SGDeviceName = 
   RECORD
      name:    Str63;      {device name}
      icon:    Handle;     {device icon}
      flags:   LongInt;    {flags}
      refCon:  LongInt;    {set to 0}
      reserved: LongInt;   {reserved--set to 0}
   END;
   SGDeviceListPtr = ^SGDeviceListRecord;
   SGDeviceList = ^SGDeviceListPtr;
   SGDeviceListRecord = 
   RECORD
      count:         Integer;                      {count of devices}
      selectedIndex: Integer;                      {current device}
      reserved:      LongInt;                      {reserved--set to 0}
      entry:         ARRAY[0..0] OF SGDeviceName;  {device names}
   END;

Sequence Grabber Component Routines

Configuring Sequence Grabber Components

FUNCTION SGInitialize (s: SeqGrabComponent): ComponentResult;
FUNCTION SGSetDataOutput (s: SeqGrabComponent; movieFile: FSSpec; 
whereFlags: LongInt): ComponentResult;
FUNCTION SGGetDataOutput (s: SeqGrabComponent; VAR movieFile: FSSpec; 
VAR whereFlags: LongInt): ComponentResult;
FUNCTION SGSetGWorld (s: SeqGrabComponent; gp: CGrafPtr; 
gd: GDHandle): ComponentResult;
FUNCTION SGGetGWorld (s: SeqGrabComponent; VAR gp: CGrafPtr; 
VAR gd: GDHandle): ComponentResult;
FUNCTION SGNewChannel (s: SeqGrabComponent; channelType: OSType; 
VAR ref: SGChannel): ComponentResult;
FUNCTION SGNewChannelFromComponent 
(s: SeqGrabComponent; 
VAR newChannel: SGChannel; 
sgChannelComponent: Component): ComponentResult;
FUNCTION SGGetIndChannel (s: SeqGrabComponent; index: Integer; 
VAR ref: SGChannel; 
VAR chanType: OSType): ComponentResult;
FUNCTION SGDisposeChannel (s: SeqGrabComponent; 
c: SGChannel): ComponentResult;
FUNCTION SGSetDataProc (s: SeqGrabComponent; proc: SGDataProc; 
refCon: LongInt): ComponentResult;
FUNCTION SGGetAlignmentProc
(s: SeqGrabComponent; 
alignmentProc: AlignmentProcRecordPtr): ComponentResult;

Controlling Sequence Grabber Components

FUNCTION SGStartPreview (s: SeqGrabComponent): ComponentResult;
FUNCTION SGStartRecord (s: SeqGrabComponent): ComponentResult;
FUNCTION SGIdle (s: SeqGrabComponent): ComponentResult;
FUNCTION SGUpdate (s: SeqGrabComponent; updateRgn: RgnHandle): 
ComponentResult;
FUNCTION SGStop (s: SeqGrabComponent): ComponentResult;
FUNCTION SGPause (s: SeqGrabComponent; 
paused: Byte): ComponentResult;
FUNCTION SGGetPause (s: SeqGrabComponent; 
VAR paused: Byte): ComponentResult;
FUNCTION SGPrepare (s: SeqGrabComponent; 
prepareForPreview: Boolean; 
prepareForRecord: Boolean): ComponentResult;
FUNCTION SGRelease (s: SeqGrabComponent): ComponentResult;
FUNCTION SGGetMovie (s: SeqGrabComponent): Movie;
FUNCTION SGGetLastMovieResID
(s: SeqGrabComponent; 
VAR resID: Integer): ComponentResult;
FUNCTION SGGrabPict (s: SeqGrabComponent; VAR p: PicHandle; 
bounds: Rect; offscreenDepth: Integer; 
grabPictFlags: LongInt): ComponentResult;

Working With Sequence Grabber Settings

FUNCTION SGSettingsDialog (s: SeqGrabComponent; c: SGChannel; 
numPanels: Integer; VAR panelList: Component; 
flags: LongInt; proc: SGModalFilterProcPtr; 
procRefNum: LongInt): ComponentResult;
FUNCTION SGGetSettings (s: SeqGrabComponent; VAR ud: UserData; 
flags: LongInt): ComponentResult;
FUNCTION SGSetSettings (s: SeqGrabComponent; ud: UserData; 
flags: LongInt): ComponentResult;
FUNCTION SGGetChannelSettings 
(s: SeqGrabComponent; c: SGChannel; 
VAR ud: UserData; flags: LongInt): ComponentResult;
FUNCTION SGSetChannelSettings
(s: SeqGrabComponent; c: SGChannel; 
ud: UserData; flags: LongInt): ComponentResult;

Working With Sequence Grabber Characteristics

FUNCTION SGSetMaximumRecordTime
(s: SeqGrabComponent; ticks: LongInt): ComponentResult;
FUNCTION SGGetMaximumRecordTime 
(s: SeqGrabComponent; VAR ticks: LongInt): ComponentResult;
FUNCTION SGGetStorageSpaceRemaining
(s: SeqGrabComponent; VAR bytes: LongInt): ComponentResult;
FUNCTION SGGetTimeRemaining(s: SeqGrabComponent; VAR ticksLeft: LongInt): 
ComponentResult;
FUNCTION SGGetTimeBase (s: SeqGrabComponent; VAR tb: TimeBase): 
ComponentResult;
FUNCTION SGSetFlags (s: SeqGrabComponent; sgFlags: LongInt): 
ComponentResult;
FUNCTION SGGetFlags (s: SeqGrabComponent; VAR sgFlags: LongInt): 
ComponentResult;

Working With Channel Characteristics

FUNCTION SGSetChannelUsage (c: SGChannel; usage: LongInt): ComponentResult;
FUNCTION SGGetChannelUsage (c: SGChannel; VAR usage: LongInt): 
ComponentResult;
FUNCTION SGGetChannelInfo (c: SGChannel; VAR channelInfo: LongInt): 
ComponentResult;
FUNCTION SGSetChannelPlayFlags
(c: SGChannel; playFlags: LongInt): ComponentResult;
FUNCTION SGGetChannelPlayFlags
(c: SGChannel; VAR playFlags: LongInt): ComponentResult;
FUNCTION SGSetChannelMaxFrames 
(c: SGChannel; frameCount: LongInt): ComponentResult;
FUNCTION SGGetChannelMaxFrames 
(c: SGChannel; VAR frameCount: LongInt): ComponentResult;
FUNCTION SGSetChannelBounds 
(c: SGChannel; bounds: Rect): ComponentResult;
FUNCTION SGGetChannelBounds
(c: SGChannel; VAR bounds: Rect): ComponentResult;
FUNCTION SGSetChannelVolume 
(c: SGChannel; volume: Integer): ComponentResult;
FUNCTION SGGetChannelVolume
(c: SGChannel; VAR volume: Integer): ComponentResult;
FUNCTION SGSetChannelRefCon
(c: SGChannel; refCon: LongInt): ComponentResult;
FUNCTION SGGetChannelSampleDescription 
(c: SGChannel; sampleDesc: Handle): ComponentResult;
FUNCTION SGGetChannelTimeScale
(c: SGChannel; VAR scale: TimeScale): ComponentResult;
FUNCTION SGGetChannelClip (c: SGChannel; VAR theClip: RgnHandle): 
ComponentResult;
FUNCTION SGGetChannelClip (c: SGChannel; VAR theClip: RgnHandle): 
ComponentResult;
FUNCTION SGGetChannelMatrix 
(c: SGChannel; VAR m: MatrixRecord): ComponentResult;
FUNCTION SGGetChannelMatrix 
(c: SGChannel; VAR m: MatrixRecord): ComponentResult;

Working With Channel Devices

FUNCTION SGGetChannelDeviceList
(c: SGChannel; selectionFlags: LongInt; 
VAR list: SGDeviceList): ComponentResult;
FUNCTION SGDisposeDeviceList 
(s: SeqGrabComponent; list: SGDeviceList): ComponentResult;
FUNCTION SGAppendDeviceListToMenu 
(s: SeqGrabComponent; list: SGDeviceList; 
mh: MenuHandle): ComponentResult;
FUNCTION SGSetChannelDevice(c: SGChannel; name: StringPtr): 
ComponentResult;

Working With Video Channels

FUNCTION SGGetSrcVideoBounds
(c: SGChannel; VAR r: Rect): ComponentResult;
FUNCTION SGSetVideoRect (c: SGChannel; r: Rect): ComponentResult;
FUNCTION SGGetVideoRect (c: SGChannel; VAR r: Rect): ComponentResult;
FUNCTION SGSetVideoCompressorType 
(c: SGChannel; compressorType: OSType): ComponentResult;
FUNCTION SGGetVideoCompressorType 
(c: SGChannel; VAR compressorType: OSType): ComponentResult;
FUNCTION SGSetVideoCompressor
(c: SGChannel; depth: Integer; 
compressor: CompressorComponent; spatialQuality: CodecQ; 
temporalQuality: CodecQ; 
keyFrameRate: LongInt): ComponentResult;
FUNCTION SGGetVideoCompressor
(c: SGChannel; VAR depth: Integer; 
VAR compressor: CompressorComponent; 
VAR spatialQuality: CodecQ; 
VAR temporalQuality: CodecQ; 
VAR keyFrameRate: LongInt): ComponentResult;
FUNCTION SGSetVideoDigitizerComponent 
(c: SGChannel; vdig: ComponentInstance): ComponentResult;
FUNCTION SGGetVideoDigitizerComponent 
(c: SGChannel): ComponentInstance;
FUNCTION SGVideoDigitizerChanged 
(c: SGChannel): ComponentResult;
FUNCTION SGSetCompressBuffer
(c: SGChannel; depth: Integer; 
compressSize: Rect): ComponentResult;
FUNCTION SGGetCompressBuffer
(c: SGChannel; VAR depth: Integer; 
VAR compressSize: Rect): ComponentResult;
FUNCTION SGSetFrameRate (c: SGChannel; 
frameRate: Fixed): ComponentResult;
FUNCTION SGGetFrameRate (c: SGChannel; 
VAR frameRate: Fixed): ComponentResult;
FUNCTION SGSetUseScreenBuffer 
(c: SGChannel; useScreenBuffer: Boolean): ComponentResult;
FUNCTION SGGetUseScreenBuffer 
(c: SGChannel; VAR useScreenBuffer: Boolean): ComponentResult;

Working With Sound Channels

FUNCTION SGSetSoundInputDriver 
(c: SGChannel; driverName: Str255): ComponentResult;
FUNCTION SGGetSoundInputDriver 
(c: SGChannel): LongInt;
FUNCTION SGSoundInputDriverChanged 
(c: SGChannel): ComponentResult;
FUNCTION SGSetSoundRecordChunkSize 
(c: SGChannel; seconds: LongInt): ComponentResult;
FUNCTION SGGetSoundRecordChunkSize 
(c: SGChannel): LongInt;
FUNCTION SGSetSoundInputRate
(c: SGChannel; rate: Fixed): ComponentResult;
FUNCTION SGGetSoundInputRate
(c: SGChannel): Fixed; 
FUNCTION SGSetSoundInputParameters 
(c: SGChannel; sampleSize: Integer; numChannels: Integer; 
compressionType: OSType): ComponentResult;
FUNCTION SGGetSoundInputParameters 
(c: SGChannel; VAR sampleSize: Integer; 
VAR numChannels: Integer; 
VAR compressionType: OSType): ComponentResult;

Video Channel Callback Routines

FUNCTION SGSetVideoBottlenecks 
(c: SGChannel; VAR vb: VideoBottles): ComponentResult;
FUNCTION SGGetVideoBottlenecks 
(c: SGChannel; VAR vb: VideoBottles): ComponentResult;

Utility Routines for Video Channel Callback Functions

FUNCTION SGGetBufferInfo (c: SGChannel; bufferNum: Integer; 
VAR bufferPM: PixMapHandle; 
VAR bufferRect: Rect; 
VAR compressBuffer: GWorldPtr; 
VAR compressBufferRect: Rect): ComponentResult;
FUNCTION SGGrabFrame (c: SGChannel; bufferNum: Integer): 
ComponentResult;
FUNCTION SGGrabFrameComplete
(c: SGChannel; bufferNum: Integer; 
VAR done: Boolean): ComponentResult;
FUNCTION SGDisplayFrame (c: SGChannel; bufferNum: Integer; 
mp: MatrixRecord; clipRgn: RgnHandle): 
ComponentResult;
FUNCTION SGCompressFrame (c: SGChannel; bufferNum: Integer): 
ComponentResult;
FUNCTION SGCompressFrameComplete 
(c: SGChannel; bufferNum: Integer; 
VAR done: Boolean; VAR ci: SGCompressInfo): ComponentResult;
FUNCTION SGAddFrame (c: SGChannel; bufferNum: Integer; 
atTime: TimeValue; scale: TimeScale; 
ci: SGCompressInfo): ComponentResult;
FUNCTION SGTransferFrameForCompress 
(c: SGChannel; bufferNum: Integer; 
mp: MatrixRecord; clipRgn: RgnHandle): ComponentResult;
FUNCTION SGGrabCompressComplete 
(c: SGChannel; VAR done: Boolean; 
VAR ci: SGCompressInfo; VAR tr: TimeRecord): ComponentResult; 
FUNCTION SGDisplayCompress (c: SGChannel; dataPtr: Ptr; 
desc: ImageDescriptionHandle; 
VAR mp: MatrixRecord; 
clipRgn: RgnHandle): ComponentResult;

Application-Defined Routines

FUNCTION MyGrabFunction (c: SGChannel; bufferNum: Integer; 
refCon: LongInt): ComponentResult;
FUNCTION MyGrabCompleteFunction 
(c: SGChannel; bufferNum: Integer; 
VAR done: Boolean; refCon: LongInt): ComponentResult;
FUNCTION MyDisplayFunction (c: SGChannel; bufferNum: Integer; 
mp: MatrixRecord; clipRgn: RgnHandle; 
refCon: LongInt): ComponentResult;
FUNCTION MyCompressFunction 
(c: SGChannel; bufferNum: Integer; 
refCon: LongInt): ComponentResult;
FUNCTION MyCompressCompleteFunction 
(c: SGChannel; bufferNum: Integer; 
VAR done: Boolean; VAR ci: SGCompressInfo; refCon: LongInt): ComponentResult;
FUNCTION MyAddFrameFunction
(c: SGChannel; bufferNum: Integer; 
atTime: TimeValue; scale: TimeScale; 
ci: SGCompressInfo; refCon: LongInt): ComponentResult;
FUNCTION MyTransferFrameFunction 
(c: SGChannel; bufferNum: Integer; 
mp: MatrixRecord; clipRgn: RgnHandle; 
refCon: LongInt): ComponentResult;
FUNCTION MyGrabCompressCompleteFunction
(c: SGChannel; VAR done: Boolean; 
VAR ci: SGCompressInfo; VAR tr: TimeRecord; refCon: LongInt): ComponentResult;
FUNCTION MyDisplayCompressFunction
(c: SGChannel; dataPtr; Ptr; 
desc: ImageDescriptionHandle; 
VAR mp: MatrixRecord; clipRgn: RgnHandle; refCon: LongInt): ComponentResult;
FUNCTION MyDataFunction(c: SGChannel; p: Ptr; len: LongInt; 
VAR offset: LongInt; chRefCon: LongInt; 
time: TimeValue; writeType: Integer; 
refCon: LongInt): OSErr;
FUNCTION MyModalFilter(theDialog: DialogPtr; 
VAR theEvent: EventRecord; 
VAR ItemHit: Integer; refCon: LongInt): OSErr;

Result Codes
noDeviceForChannel -9400Channel component cannot find its device
grabTimeComplete-9401Time limit for record operation has expired
cantDoThatInCurrentMode-9402Request invalid in current mode
notEnoughMemoryToGrab-9403Insufficient memory for record operation
notEnoughDiskSpaceToGrab-9404Insufficient disk space for record operation
couldntGetRequiredComponent-9405Component not found
badSGChannel-9406Invalid channel specified
seqGrabInfoNotAvailable-9407Sequence grabber does not have this information at this time
deviceCantMeetRequest-9408Device cannot support grabber


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help